package controller;

import model.gameModelI;
import view.froggerView;
//this is a change
//delegates events to currentSTate object

public class userInputHandler {
	static final frogState onLogState = new onLog() ;
	static final frogState crossedRiverState = new crossedRiver() ;
	static final frogState jumpingState = new jumping() ;
	static final frogState onBankState = new onBank() ;
	private frogState currentState;
	gameModelI model;
	froggerView view;
	
	//constructor	 
	public userInputHandler(gameModelI m, froggerView v) {
		
		this.currentState = onBankState;	
		this.model = m;
		this.view = v;
		
	}
	
	public void processInput(char keyinput) {
		currentState.handleInput(this, keyinput);
		view.repaint();
	}
	 
	private void setState(frogState state) {
		this.currentState = state;
	}
	

}
